<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        let p = new Promise((resolve,reject)=>{
            resolve('ok')
        })

        let result = p.then(value => {
            // 1、抛出错误
            throw '问题';
            // 返回结果是非promise对象
            return 51;
        },reason=>{
            console.log(reason)
        })
        console.log(result)


        let p1 = new Promise((resolve,reject)=>{
            resolve('ok')
        })

        let result = p1.then(value => {
            // 3、返回promise对象 看返回的是什么决定
            return new Promise((resolve,reject)=>{
                resolve(521);
                // reject('err');
            })
        },reason=>{
            console.log(reason)
        })

        console.log(result)
    </script>
</body>
</html>